<?php
class BookCourseEvaluationDao {
	private $table = 'book_course_evaluation';

	public function add($data){
		ClassManager::getSql()->insert('book_course_evaluation',$data);
	}
	public function searchList($where=array(),$order='',$limit=0){
		$where = $this->searchWhere($where);
		return ClassManager::getSql()->dataList1($this->table,'*',$where,$order,$limit);
	}
	public function searchData($where=array()){
		$where = $this->searchWhere($where);
		return ClassManager::getSql()->onedata1($this->table,'*',$where);
	}
	public function searchNumber($where= array()){
		$where = $this->searchWhere($where);
		$tmp = ClassManager::getSql()->onedata1($this->table,"count(*)  ",$where);
		return $tmp[0];
	}
	public function searchWhere($where){
		$where1 = array();
		foreach ($where as  $k=>$v){
			if (!empty($v)){
				$where1[$k] = $v;
			}
		}
		unset($where);
		return $where1;
	}
}

?>